# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-yaspin
pkgver=2.5.0
pkgrel=1
pkgdesc="Yet Another Terminal Spinner"
url="https://github.com/pavdmyt/yaspin"
license=('MIT')
arch=('any')
depends=('python-termcolor')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest')
source=("https://github.com/pavdmyt/yaspin/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('90c270810312eea1de88119939439f7bb24a215711838e5a4a67a7353e9450283aaa82ea2bc0facfff187c221e6fbc5275a9510cf889eda5e7d426f5bb7fa690')

build() {
  cd yaspin-$pkgver
  python -m build --no-isolation --wheel
}

check() {
  cd yaspin-$pkgver
  python -m pytest
}

package() {
  cd yaspin-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
